import 'package:dio/dio.dart';
import 'package:erp/global.dart';

//region NETWORK COMMUNICATIONS
const String NETWORK_COMMUNICATION_REQUEST = "network.communication.request";
const String NETWORK_COMMUNICATION_RESPONSE = "network.communication.response";
const String MAKE_SERVER0_REQUEST = "make.server0.request";
//endregion

void registerNetworkCommunicationEvents() {
  globalBus.subscribe<Object>(NETWORK_COMMUNICATION_RESPONSE, (bus, response) async {
    if (response is Response<dynamic>){

    }
    else if (response is DioError){
      log(response.response.data, context: "HTTP Error");
    }
    else {
      log(response, context: response.runtimeType);
    }
  });
}


